package com.hea7en.user.controller;

import com.hea7en.model.common.dto.ResponseResult;
import com.hea7en.model.user.dto.LoginDto;
import com.hea7en.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: hea7en
 * @Date: 2024/8/17 3:05 PM
 * @Description: 用户模块控制层
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/login")
@Api(tags = "用户相关接口")
public class UserController {
    @Autowired
    UserService userService;

    /**
     * 用户登录
     * @param loginDto
     * @return
     */
    @PostMapping("/login_auth")
    @ApiOperation("用户登录")
    public ResponseResult login(@RequestBody LoginDto loginDto){
        log.info("用户登录:{}", loginDto);

        return userService.login(loginDto);
    }
}
